import request from '@/utils/request'

// 查询岗位列表
export function listPost(query) {
  return request({
    url: '/scrap/stock/in/list',
    method: 'get',
    params: query
  })
}

// 查询记录表详细
export function getPost(postId) {
  return request({
    url: '/scrap/stock/in/info/' + postId,
    method: 'get'
  })
}

// 新增岗位
export function addPost(data) {
  return request({
    url: '/scrap/stock/in/add',
    method: 'post',
    data: data
  })
}

// 修改岗位
export function updatePost(data) {
  return request({
    url: '/scrap/stock/in/edit',
    method: 'post',
    data: data
  })
}

// 删除记录单
export function delPost(postId) {
  return request({
    url: '/scrap/stock/in/remove/' + postId,
    method: 'delete'
  })
}

// 新增修改申请表
export function addApply(data) {
  return request({
    url: '/scrap/apply/add',
    method: 'post',
    data: data
  })
}
// 删除申请单
export function delApply(postId) {
  return request({
    url: '/scrap/apply/remove/' + postId,
    method: 'delete'
  })
}
// 获取下一级审核人
export function auditorList(data) {
  return request({
    url: data.applyId?'/scrap/apply/auditor/'+data.applyId:'/scrap/apply/auditor',
    method: 'get',
    data: data
  })
}

// 待审核列表
export function listAudit(data) {
  return request({
    url: '/scrap/apply/audit/list',
    method: 'get',
    params: data
  })
}

// 申请单列表
export function listApply(data) {
  return request({
    url: '/scrap/apply/list',
    method: 'get',
    params: data
  })
}

// 申请单详情
export function applyInfo(data) {
  return request({
    url: '/scrap/apply/info/'+data.applyId,
    method: 'get',
    data: data
  })
}

// 审核
export function applyAudit(data) {
  return request({
    url: '/scrap/apply/audit',
    method: 'post',
    data: data
  })
}

// 入库单列表
export function listInto(data) {
  return request({
    url: '/scrap/into/list',
    method: 'get',
    params: data
  })
}


// 导出台账
export function scrapIntoExport(data) {
  return request({
    url: '/scrap/into/export',
    method: 'get',
    data: data
  })
}

// 入库单详情
export function intoInfo(data) {
  return request({
    url: '/scrap/into/'+data.id,
    method: 'get',
    data: data
  })
}

// 新增修改入库单
export function scrapInto(data) {
  return request({
    url: '/scrap/into',
    method: 'post',
    data: data
  })
}

// 出库单详情
export function outInfo(data) {
  return request({
    url: '/scrap/out/'+data.id,
    method: 'get',
    data: data
  })
}

// 新增修改出库单
export function scrapOut(data) {
  return request({
    url: '/scrap/out',
    method: 'post',
    data: data
  })
}

// 删除记录单
export function removeInto(data) {
  return request({
    url: '/scrap/into/remove/' + data.ids,
    method: 'delete',
    data: data
  })
}

// 删除记录单
export function removeOut(postId) {
  return request({
    url: '/scrap/out/remove/' + postId.ids,
    method: 'delete',
    data: postId
  })
}
